const mongoose =require("mongoose");
const Schema=mongoose.Schema;

//Create Scahema
const PostSchema=new Schema({
    author:{
        type: Schema.Types.ObjectId, ref: 'users',
        required:true,
    },
    title:{
        type:String,
        required:true
    },
    content:{
        type:String,
        require:true,
    },
    postDate:{
        type:Date,
        default:Date.now
    },
})

module.exports=Post=mongoose.model("posts",PostSchema);